#pragma once
#include <map>
#include <string>
#include <memory>
#include <easyx.h>


class imageManager
{
public:
	static imageManager* getInstaance();
	IMAGE* loadImage(const std::string& file, int w = 0, int h = 0);

	void cacheImage(const std::string& tag, const std::string& file, int w = 0, int h = 0);

	IMAGE* getImage(const std::string& tag);

	static void drawImg(int x, int y, IMAGE* src);

	static void drawImg(int x, int y, int dstW, int dstH, IMAGE* src, int srcX, int srcY);


private:
	imageManager() {};
	std::map<std::string, std::unique_ptr<IMAGE>> m_inages;

};

